package com.kb.vo.components;

import com.fasterxml.jackson.annotation.JsonAlias;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel(description = "调用远程登录返回结果")
public class LoginResponseVO implements Serializable {

    @ApiModelProperty(value = "状态码")
    @JsonAlias("code")
    private Integer code;

    @ApiModelProperty(value = "登录数据")
    @JsonAlias("data")
    private LoginData data;

    @ApiModelProperty(value = "返回信息")
    @JsonAlias("msg")
    private String msg;

    @Data
    @ApiModel(description = "登录返回的详细数据")
    public static class LoginData implements Serializable {

        @ApiModelProperty(value = "用户ID")
        @JsonAlias("userId")
        private Integer userId;

        @ApiModelProperty(value = "访问令牌")
        @JsonAlias("accessToken")
        private String accessToken;

        @ApiModelProperty(value = "刷新令牌")
        @JsonAlias("refreshToken")
        private String refreshToken;

        @ApiModelProperty(value = "令牌过期时间（时间戳）")
        @JsonAlias("expiresTime")
        private Long expiresTime;
    }
}